<?php
class Success extends Controller {
	private $mail = array(
		//微软
		'hotmail.com' 	=> 'http://mail.hotmail.com/',
		'msn.com' 		=> 'http://mail.hotmail.com/',
		
		//新浪
		'sina.com'		=> 'http://mail.sina.com.cn/',
		'sina.cn'		=> 'http://mail.sina.com.cn/',
	
		//QQ
		'qq.com' 		=> 'http://mail.qq.com/',
	
		//网易
		'163.com' 		=> 'http://mail.163.com/',
		'vip.163.com' 	=> 'http://vip.163.com/',
	
	);
	public function html() {
		//已登录跳转到转入页面
		$mUser = new User_model();
		$currUser = $mUser->currUser();
		if($currUser) header('Location: '.$this->backurl());
		
		if(!$this->isPost()) header('Location: /user/registe');
		$email = $this->post('email', 'str');
		//获取邮箱域名
		$data['email'] = $email;
		$domain = substr($email, strpos($email, '@')+1);
		if(isset($this->mail[$domain])) $data['mail'] = $this->mail[$domain];
		$tpl = 'user/success.html';
		$this->display($data, $tpl);
	}
}